<?php if (isset($result)==NULL){ ?>
<?php $atr=array(
					"name"=>"customerReport",
					"onsubmit"=>"return checkCustomerReport()"
				  ); 
echo form_open('customerReport',$atr); ?>
<table border="0" cellspacing="1" align="left"  width="600px">
	<tr>
		<td>Lab_ID</td>
		<td>FromDate</td>
		<td>ToDate</td>
	</tr>
	<tr>
		<td> <?php echo form_dropdown('Lab_ID', $lab);?></td>
		<td> <input type="text" name="FromDate" id="Date" onclick="loadCalendar(this.id);" /></td>
		<td><input type="text" name="ToDate" id="Date1" onclick="loadCalendar(this.id);" /></td>
	</tr>
</table>
<table border="0" cellspacing="1" align="left"  width="600px">
	<tr>
		<td width="165px"><input type="radio" name="type" value="OverTime" id="overtime" />OverTime</td>
		<td><input type="text" name="OverTime"  /></td>
	</tr>			
	<tr>	
		<td><input type="radio" name="type" value="Percent" id="percent" />PerCent</td>
		<td><input type="text" name="Percent" /></td>
	</tr>
	<tr>	
		<td><input type="submit" name="submit" value="search" id="submit" /></td>		
	</tr>
</table>
<?php echo form_close();}?>

<?php if (isset($result)){ $bar="Customer Report";

?>

<table id="box-table-a" cellspacing="1" align="right"  width="900px">
	<tr>
		<td colspan=8 align=right class=bar><?php echo $bar;?></td>
	</tr>
	<tr>
		<th>Staff_ID</th>	
		<th>FromDate</th>
		<th>ToDate</th>
		<th>Basic Salary</th>		
		<th>Act Salary </th>
		<th>OverTime Salary </th>
		<th>Total</th>		
	</tr>
	<?php foreach ($result as $row){?>
	<tr>
		<td><?php echo $row->Staff_ID;?></td>
		<td><?php echo $row->FromDate;?></td>
		<td><?php echo $row->ToDate?></td>
		<td><?php echo $row->BasicSalary?></td>
		<td><?php echo $row->ActSalary;?></td>
		<td><?php echo $row->OTSalary;?></td>
		<td><?php echo $row->PaySalary;?></td>		
		
	</tr>
	<?php } ?>		
</table>
<?php
	$data['FromDate']=$FromDate;
	$data['ToDate']=$ToDate;
	$data['Lab_ID']=$Lab_ID;
	$this->session->set_userdata($data);
?>
<a href="exel/CustomerExcel">Excel</a>
<?php  }?>